POV-Ray : Newsgroups : povray.binaries.images : texture_map problem : texture_map problem Server Time
2 Nov 2024 12:22:39 EDT (-0400)
  texture_map problem  
From: Jörg 'Yadgar' Bleimann
Date: 15 Dec 2010 06:25:06
Message: <4d08a592@news.povray.org>
High!

Meanwhile, I got some raw version of the vegetation texture for southern 
Tasmania (just a heightfield exercise in between, don't worry, I'll 
switch back to Khyberspace as soon as possible!) ready... it consists of 
a texture_map containing five texture_maps, each of them again is a 
slope pattern containing two or three basic textures:

// Basic textures

#declare T_Beach=
texture
{
   pigment { color rgb <1, 1, 0.5> }
   finish { ambient 0.05 diffuse 1 brilliance 0.25 }
}

#declare T_Meadow=
texture
{
   pigment { color rgb <0.1, 0.7, 0.2> }
   finish { ambient 0.05 diffuse 1 brilliance 0.5 }
}

#declare T_Forest=
texture
{
   pigment { color rgb <0, 0.5, 0.2> }
   finish { ambient 0.05 diffuse 1 brilliance 0.42 }
}

#declare T_Shrub=
texture
{
   pigment { color rgb <0.65, 0.78, 0.2> }
   finish { ambient 0.05 diffuse 1 brilliance 0.31 }
}

#declare T_Rock=
texture
{
   pigment { color rgb 0.7 }
   finish { ambient 0.05 diffuse 1 brilliance 0.5 }
}

#declare T_Snow=
texture
{
   pigment { color rgb 1 }
   finish { ambient 0.05 diffuse 1 brilliance 0.18 }
}

// Slope-patterned texture_maps

#declare TM_Shore=
texture
{
   slope { <0, -1, 0> }
   texture_map
   {
     [0     T_Beach ]
     [0.2 T_Beach ]
     [0.2 T_Forest ]
     [0.4 T_Forest ]
     [0.4 T_Rock ]
     [0.5 T_Rock ]
   }
}

#declare TM_Lowlands=
texture
{
   slope { <0, -1, 0> }
   texture_map
   {
     [0     T_Meadow ]
     [0.06  T_Meadow ]
     [0.065 T_Forest ]
     [0.4 T_Forest ]
     [0.4 T_Rock ]
     [0.5 T_Rock ]
   }
}

#declare TM_Highlands=
texture
{
   slope { <0, -1, 0> }
   texture_map
   {
     [0   T_Forest ]
     [0.4 T_Forest ]
     [0.4 T_Rock ]
     [0.5 T_Rock ]
   }
}

#declare TM_SubAlpine=
texture
{
   slope { <0, -1, 0> }
   texture_map
   {
     [0   T_Shrub ]
     [0.4 T_Shrub ]
     [0.4 T_Rock ]
     [0.5 T_Rock ]
   }
}

#declare TM_Alpine=
texture
{
   slope { <0, -1, 0> }
   texture_map
   {
     [0   T_Snow ]
     [0.4 T_Snow ]
     [0.4 T_Rock ]
     [0.5 T_Rock ]
   }
}

// Overall texture map

#declare h=max_extent(terrain).y-min_extent(terrain).y;

#declare TMM_Tasmania=
texture
{
   gradient y
   texture_map
   {
     [0            TM_Shore]
     [h/2/h        TM_Shore]
     [(h+3)/2/h  TM_Shore]
     [(h+3)/2/h  TM_Lowlands]
     [(h+200)/2/h TM_Lowlands]
     [(h+200)/2/h TM_Highlands]
     [(h+900)/2/h   TM_Highlands]
     [(h+900)/2/h TM_SubAlpine]
     [(h+1200)/2/h TM_SubAlpine]
     [(h+1200)/2/h TM_Alpine]
     [1 TM_Alpine]
   }
   scale 2*h
   translate -y*h
}

I originally scaled the overall texture_map to double y extent of the 
heightfield and than translated it along the y axis to have some scope 
for turbulence (otherwise, TM_Alpine would show up along the shores). 
Probably I'll redo this, as general turbulence for the whole texture 
would yield undesirable results...

Note that with the scene attached below, TM_Alpine does not appear as 
the mountains visible from the chosen camera position are not high enough.

But as TMM_Tasmania uses a y gradient without turbulence, the boundary 
between TM_Highlands and TM_SubAlpine is unnaturally straight (see image 
below) - while keeping a sharp boundary between forest and subalpine 
shrub, I would like to have the boundary "patchy" at an intermediate 
scale. When I apply a general turbulence to TMM_Tasmania, the constraint 
of the "beach" part to the lowest  and closest to the sea parts of the 
heightfields is lost... and, otherwisely, separating the SubAlpine and 
AlpineParts (with a third, transparent texture for the lower regions) 
from TMM_Tasmania and superimposing it as a second texture layer won't 
work either, as PoV-Ray generally is not able to layer mapped textures...

How do I get a more realistic upper forest line?

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2010-12-15 southwestern tasmania, take 16.jpg' (36 KB)

Preview of image '2010-12-15 southwestern tasmania, take 16.jpg'
2010-12-15 southwestern tasmania, take 16.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.